{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```java\n",
    "/**\n",
    " * Definition for singly-linked list.\n",
    " * public class ListNode {\n",
    " *     int val;\n",
    " *     ListNode next;\n",
    " *     ListNode(int x) { val = x; }\n",
    " * }\n",
    " */\n",
    "class Solution {\n",
    "    public ListNode reverseList(ListNode head) {\n",
    "        ListNode dummy = head;\n",
    "        ListNode tmp = head;\n",
    "        \n",
    "        while (head != null && head.next != null) {\n",
    "            dummy = head.next;\n",
    "            head.next = dummy.next;\n",
    "            dummy.next = tmp;\n",
    "            tmp = dummy;\n",
    "        }\n",
    "        \n",
    "        return dummy;\n",
    "    }\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
